function print() {
    $(".assess-print-div textarea").each(function () {
        this.style.height = this.scrollHeight < 75 ? this.scrollHeight : this.scrollHeight * (($(this).width() / 14) / 42);
    });
    $(".assess-print-div .table-input").each(function () {
        if (!$(this).hasClass("date-input")) {
            this.style.width = $(this).val().length == 0 ? 100 : $(this).val().length * 18;
        }
    });
    var printHtml = $(".modal-main-div .assess-print-div").clone()

    printHtml.find("input").each(function () {
        var value = $(this).val();
        var paretDiv = $(this).closest(".layui-table-cell");
        $(this).remove();
        paretDiv.html(value);
    });

    printHtml.find("table").each(function (){
        $(this).css({
            "width": "100%",
            "table-layout": "auto",
            "boder-collapse": "collapse"
        });
    });

    printHtml.find(".layui-table-main [class*='laytable-cell-']").each(function () {
        $(this).css({"width": "100%"});
    });

    printHtml.find(".layui-table-header [class*='laytable-cell-']").each(function () {
        $(this).css({"width": "100%"});
    });

    $(".assess-print-div textarea").each(function () {
        this.style.height = 30;
    });


    $(".assess-print-div .table-input").each(function () {
        if (!$(this).hasClass("date-input")) {
            this.style.width = 100;
        }
    });

    element.render();
    form.render();

    var style = `
            <style>
                @media print {                   
                    #evaluateResultInfo {
                        display: flex;
                        justify-content: space-between;
                        flex-wrap: nowrap;
                    }
                }
            </style>
        `;

    $(".layui-layout").addClass("hide");
    $(".layui-layer-shade").addClass("hide");
    $(".layui-layer").addClass("hide")

    $("#printDiv").html("<div>" + style + printHtml[0].outerHTML + "</div>").removeClass("hide");

    $("#printDiv .layui-table-header th").each(function (index) {
        var width = ($(this).outerWidth() / $(this).closest("table").outerWidth()) * 100;
        $("#printDiv .layui-table-main td:nth-child(" + (index + 1) + ")").css({
            "width": width + "%",
            "box-sizing": "border-box"
        });
    });

    window.print();

    $(".layui-layout").removeClass("hide");
    $(".layui-layout-shade").removeClass("hide");
    $(".layui-layer").removeClass("hide");

    $("#printDiv").html("").addClass("hide");
}



